package com.itheima.chapter04.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;

@Controller
public class HelloController {
    @GetMapping("/hello")
    public String hello(Model model){
        List<String> list = new ArrayList<>();
        list.add("tom");
        list.add("jerry");
        model.addAttribute("currentyear","控制器传入的值2035");
        model.addAttribute("userlist",list);
        return "hello1";
    }
}
